﻿@model VacationsRequest.Models.VacationApproval
@{
    ViewBag.Title = "Edit Approval";
}
<h2>
    @ViewBag.EmployeeName</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Approve / Reject Vacations</legend>
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(model => model.IdUserApprove)
        @Html.HiddenFor(model => model.IdEmployee)
        @Html.HiddenFor(model => model.Deleted)
        @Html.HiddenFor(model => model.DateCreated)
        @Html.HiddenFor(model => model.FromDate)
        @Html.HiddenFor(model => model.ToDate)
        @Html.HiddenFor(model => model.NumDays)
        @Html.HiddenFor(model => model.Notified)
        @Html.HiddenFor(model => model.Comment)
        @Html.HiddenFor(model => model.ApprovalDate)
        <div style="display: table; width: 100%">
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="display-label">
                        Date Created</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.DateCreated)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="display-label">
                        From Date</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.FromDate)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="display-label">
                        To Date</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.ToDate)
                    </div>
                </div>
            </div>
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="display-label">
                        Number of Days Reserved</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.NumDays)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="display-label">
                        @Html.LabelFor(model => model.Notified)</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.Notified)
                    </div>
                </div>
                <div style="display: table-cell">
                </div>
            </div>
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="display-label">
                        @Html.LabelFor(model => model.IdStatus, "Status")</div>
                    <div class="display-field">
                        @if (Model.IdStatus == 1)
                        {
                            @Html.DropDownList("IdStatus")
                            @Html.ValidationMessageFor(model => model.IdStatus)
                        }
                        else
                        {
                            @Html.DisplayFor(model => model.Status.Description) 
                        }
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="display-label">
                        Approver Comment</div>
                    <div class="display-field">
                        @Html.EditorFor(model => model.ApproverComment)
                        @Html.ValidationMessageFor(model => model.ApproverComment)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="display-label">
                        User Comment</div>
                    <div class="display-field">
                        @Html.DisplayFor(model => model.Comment)
                    </div>
                </div>
            </div>
        </div>
        @if (Model.IdStatus == 1)
        {
            <p>
                <input type="submit" value="Save" />
            </p>
        }
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
